<?php

namespace App\Jobs;

use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
use App\Models\Coupon;
class SendCoupons implements ShouldQueue
{
    use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

    protected $user_id,$coupons_config_id;
    /**
     * Create a new job instance.
     *
     * @return void
     */
    public function __construct(int $user_id,int $coupons_config_id)
    {
        //
        $this->user_id = $user_id;
        $this->coupons_config_id = $coupons_config_id;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        Coupon::addCoupon($this->user_id,$this->coupons_config_id);
    }
}
